<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">--</div>

    <script>
        var value = 1;

        function task() {
            console.log("更新html")
                // document.querySelector("#app").innerHTML = value;
        }

        function doSomeThing() {
            //value每修改一次，就要同步以下html
            value++;
            task();

        }
        doSomeThing();
        doSomeThing();
        doSomeThing();
        doSomeThing();
    </script>
</body>

</html>